package com.jintu.portal.pojo.submit;

import com.alibaba.fastjson.JSONObject;
import com.jintu.portal.pojo.RetEntity;
import lombok.Data;

/**
 * @author very
 */
@Data
public class DataResponse {

    private String orderId;
    private Integer orderStats;
    private String retCode;
    private String retMessage;
    private String dataSourceCode;
    private JSONObject responseJson;

    private DataResponse() {
    }

    public static DataResponse build(RetEntity retEntity, Integer orderStats) {
        DataResponse response = new DataResponse();
        response.setRetCode(retEntity.getCode());
        response.setRetMessage(retEntity.getMessage());
        response.setOrderStats(orderStats);
        response.setOrderId(ResponseCommonData.ORDER_ID_AND_EXT_DATA.get().get(ResponseCommonData.ORDER_ID));
        return response;
    }

}
